#ifndef _TBHASHMANAGER_H_
#define _TBHASHMANAGER_H_

#include "TBSettings.h"

#include "TBString2.h"

#include <windows.h>
#include <wincrypt.h>

namespace tb
{

	class TB_DLL_FUNC HashValue
	{

	public:

		HashValue(const unsigned char* a_Data, unsigned int a_DataLength);
		~HashValue();

	private:

		char m_Data[32];

	}; // class HashValue

	class TB_DLL_FUNC HashManager
	{

	public:

		static HashManager& Get();

		bool HashMD5(char* a_Target, const unsigned char* a_Data, unsigned int a_DataLength);
		tb::String HashedToString(const char* a_String, unsigned int a_Length);
	
	protected:
	
		HashManager();
		~HashManager();
		
		static HashManager* s_Instance;

		HCRYPTPROV m_HandleMD5;
		HCRYPTHASH m_HashMD5;
	
	}; // class HashManager

}; // namespace tb
	
#endif